package dev.ece.suit.loader;

import java.io.InputStream;
import java.nio.FloatBuffer;
import java.util.Map;

import org.lwjgl.opengl.GL20;

import dev.ece.suit.utils.ShaderFunctions;

public class FrameModelDepthShader extends ModelDepthShader {
	
	private static FrameModelDepthShader defaultModelDepthShader;
	
	public static FrameModelDepthShader getDefaultModelDepthShader() {
		if(defaultModelDepthShader == null) {
			defaultModelDepthShader = new FrameModelDepthShader(
					FrameModelDepthShader.class.getClassLoader().getResourceAsStream("shaders/framemodel3ddepth.vert"),
					FrameModelDepthShader.class.getClassLoader().getResourceAsStream("shaders/framemodel3ddepth.frag"),
					ShaderFunctions.getFunctions());
		}
		return defaultModelDepthShader;
	}
	
	public FrameModelDepthShader(StringBuffer vertexShaderString,
			StringBuffer pixelShaderString, Map<String, String> functions) {
		super(vertexShaderString, pixelShaderString, functions);
	}
	
	public FrameModelDepthShader(InputStream vertexShaderInputStream,
			InputStream pixelShaderInputStream, Map<String, String> functions) {
		super(vertexShaderInputStream, pixelShaderInputStream, functions);
	}
	
	@Override
	public void glJointsLocalMatrix(Joint<?>[] joints) {
		
	}

	@Override
	public void setLocalSkeletonMatrixBuffer(FloatBuffer localSkeletonMatrixBuffer) {
	}

	@Override
	protected void onInitializeHandler(int program) {
		super.setLocalSkeletonMatrixBuffer(null);
	}

	@Override
	protected void onBindAttribLocations(int program) {
		GL20.glBindAttribLocation(program, 0, "ece_Vertex");
	}

	@Override
	public void clearup() {
		this.deleteProgram();
	}
	
}
